package net.yla.smartbus.core.enums;

/**
 * @author 默苍离
 * @date 2021/6/28 14:51
 * <p>
 * ******************************************
 * @annotation:驾驶此车辆所需最低等级的驾照 枚举
 */
public enum DrivingLicenseEnum {

    /**
     * 驾驶此车辆所需最低等级的驾照 枚举
     */
    A1(0x0001),
    A2(0x0002),
    A3(0x0004),
    B1(0x0008),
    B2(0x0010),
    C1(0x0020),
    C2(0x0040),
    C3(0x0080),
    C4(0x0100),
    C5(0x0200),
    D(0x0400),
    E(0x0800),
    F(0x1000),
    M(0x2000),
    N(0x4000),
    P(0x8000);

    private Integer value;

    DrivingLicenseEnum(Integer value) {
        this.value = value;
    }

    public Integer getValue() {
        return value;
    }

    public static String getName(Integer value) {
        String name = "---";
        for (DrivingLicenseEnum rankEnum : DrivingLicenseEnum.values()) {
            if (rankEnum.value.equals(value)) {
                if (value != 0) {
                    name = rankEnum.name();
                }
            }
        }
        return name;
    }

}
